home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000067_icon-group-sender _Fri Mar 8 10:23:30 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Fri, 8 Mar 1996 09:04:10 MST
Message-Id: <31400AA2.6B5E@tees.ac.uk>
Date: Fri, 08 Mar 1996 10:23:30 +0000
From: Ken Walker <kwalker@premenos.com>
X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
Mime-Version: 1.0
To: icon-group@cs.arizona.edu
Subject: Re: 'right-handed' operators
References: <313F0690.6BBD@gemini.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
Steve Wampler wrote:
> Why not just use the following for those (hopefully rare)
> cases where the right-hand side value is needed:
>
> rhsv("<",e1,e2)
>
> where rhsv is:
>
> procedure rhsv(op, l, r)
> return if op(l,r) then r
> end
I don't know if Steve actually meant the left-hand-side value,
because it's the RHS that is normally produced by operators.
However assuming that we have an equivalent lhsv procedure, then
I would agree that
write(e1 < lhsv("<",e2,e3))
is better than
write(e1 < ((temp := e2) < e3, temp)) # help ma bob!
but I still have a partiality for
write(e1 < e2 ^< e3)
One observation about the lhsv procedure: Because the second
expression may not be susceptible to repeated evaluation (e.g.
because it might read from a file), the code would have to be
return if op(temp:=l,r) then temp
While I wouldn't quite say that the RHS was required only rarely,
nevertheless I think it's true that we need to have an operator
produce its LHS just as often as the RHS. I would like the
language to support that without requiring the rather inelegant
workarounds currently necessary.
| Hamish Lawson, School of Computing and Mathematics,
| University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA
| Tel: +44 1642 218121 x3611 Fax: +44 1642 342604
| E-mail: H.Lawson@tees.ac.uk